package com.jolink.omiis.commons.mongodb.api;

import java.util.List;
import java.util.Map;

import org.bson.conversions.Bson;

/**
 * mongodb 操作API
 * 
 * mongodb为nosql数据库 在mongodb中的collection概念即对应rdbms中的table
 * document对应rdbms-table中的row
 * 
 * @author zhuozhilian
 *
 */
public interface IMongodbProcessor {

	boolean delete(String collectionName, Bson filter) throws Exception;

	boolean insertOne(String collectionName, Map<String, Object> row) throws Exception;

	boolean update(String collectionName, Map<String, Object> row, Bson filter) throws Exception;

	List<Map<String, Object>> find(String collectionName, Bson filter) throws Exception;

	List<Map<String, Object>> find(String collectionName) throws Exception;

	boolean insertMany(String collectionName, List<Map<String, Object>> rows) throws Exception;

}
